// 移除类型导入语句
// 检查用户是否有某个权限
export function hasPermission(user, permissionCode) {
  return user.roles.some(role => 
    role.permissions.some(perm => perm.code === permissionCode)
  );
}

// 检查用户是否有任一权限
export function hasAnyPermission(user, permissionCodes) {
  return permissionCodes.some(code => hasPermission(user, code));
}

// 检查用户是否有所有权限
export function hasAllPermissions(user, permissionCodes) {
  return permissionCodes.every(code => hasPermission(user, code));
}